package com.sky.backend.system.controller;

import com.sky.backend.system.entity.SystemMenu;
import com.sky.backend.system.service.impl.SystemMenuServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/systemMenu")
public class SystemMenuController {
    @Autowired
    private SystemMenuServiceImpl systemMenuService;

    @RequestMapping("/insert")
    public int insert(SystemMenu entity) {
        return systemMenuService.insert(entity);
    }

    @RequestMapping("/deleteByPrimaryKey")
    public int deleteByPrimaryKey(Integer id) {
        return systemMenuService.deleteByPrimaryKey(id);
    }

    @RequestMapping("/updateByPrimaryKey")
    public int updateByPrimaryKey(SystemMenu record) {
        return systemMenuService.updateByPrimaryKey(record);
    }

    @RequestMapping("/selectAll")
    public List<SystemMenu> selectAll() {
        return systemMenuService.selectAll();
    }
}